package exercise.day6;
import java.util.*;

/**
 * @author Dianzhi Han
 * @version 1.0
 * @description: TODO
 * @date 2022/10/30 22:32
 */
public class WY18_countHuiwen {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        String str1 = in.nextLine();
        String str2 = in.nextLine();
        int count = 0;
        String temp="";
        for(int i = 0;i<= str1.length();i++){
            if(i==0){
                temp = str2+str1;
            }
            else if(i == str1.length()){
                temp = str1 + str2 ;
            }
            else{
                temp = str1.substring(0,i) + str2 + str1.substring(i,str1.length());
            }

            if(isHuiwen(temp)){
                count++;
            }
        }

        System.out.print(count);
    }

    public static boolean isHuiwen(String str){
        String reverse = "";
        for(int i = str.length()-1;i>=0;i--){
            reverse = reverse + str.charAt(i);
        }

        if(str.equals(reverse)){
            return true;
        }

        return false;

    }
}
